package com.zmx.b2c.pay.entity;

import com.zmx.common.common.entitys.BaseEntity;
import lombok.Data;

import javax.persistence.*;

import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.math.BigDecimal;

/**
 * @author zhaomxr
 * null
 */
@Data
@Entity
@Table(name = "payment")
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper=true)
@Inheritance(strategy = InheritanceType.JOINED)
public class Payment extends BaseEntity {

	/**
	 * 支付金额
	 */
	@Column(name = "amount")
	private BigDecimal amount;

	/**
	 * 手续费
	 */
	@Column(name = "fee")
	private BigDecimal fee;

	/**
	 * null
	 */
	@Column(name = "memo")
	private String memo;

	/**
	 * 在线支付0,线下支付1
	 */
	@Column(name = "method")
	private Integer method;

	/**
	 * 支付人
	 */
	@Column(name = "payer")
	private String payer;

	/**
	 * null
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@Column(name = "payment_date")
	private java.util.Date paymentDate;

	/**
	 * null
	 */
	@Column(name = "payment_method")
	private String paymentMethod;

	/**
	 * null
	 */
	@Column(name = "payment_plugin_id")
	private String paymentPluginId;

	/**
	 * 支付单号
	 */
	@Column(name = "sn")
	private String sn;

	/**
	 * 父支付单编号
	 */
	@Column(name = "parent_sn")
	private String parentSn;

	/**
	 * 支付状态 0未支付，1已支付，2支付失败
	 */
	@Column(name = "status")
	private Integer status;

	/**
	 * null
	 */
	@Column(name = "member_id")
	private Long memberId;

	/**
	 * null
	 */
	@Column(name = "orders")
	private Long orders;

	/**
	 * 第三方支付单号
	 */
	@Column(name = "payment_serial_number")
	private String paymentSerialNumber;

	/**
	 * 值为0-微商城
	 */
	@Column(name = "pay_type")
	private Integer payType;

	/**
	 * null
	 */
	@Column(name = "is_enabled")
	private Integer isEnabled;

	/**
	 * 平台 0-自营
	 */
	@Column(name = "platform")
	private Integer platform;


}
